php redirect to another page

63

php redirect to another page -

if (/*Condition to redirect*/){
  //You need to redirect
  header("Location: http://www.yourwebsite.com/user.php"); /* Redirect browser */
  exit();
 }
else{
  // do some
}

How do I make a redirect in PHP? -

header("Location: http://example.com/redirect_page.php");
die(); //Force the script to quit, or you would raise an error...

Php redirect -

<?php header ("location: http://domain.com/"); ?>

Comments

Submit
0 Comments